home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / gawk-3.000 / gawk-3 / gawk-3.0.0 / awklib / eg / lib / nextfile.awk < prev    next >
Encoding:
Text File  |  1996-01-11  |  388 b   |  16 lines

  1. # nextfile --- skip remaining records in current file
  2. # correctly handle successive occurrences of the same file
  3. # Arnold Robbins, arnold@gnu.ai.mit.edu, Public Domain
  4. # May, 1993
  5.  
  6. # this should be read in before the "main" awk program
  7.  
  8. function nextfile()   { _abandon_ = FILENAME; next }
  9.  
  10. _abandon_ == FILENAME {
  11.       if (FNR == 1)
  12.           _abandon_ = ""
  13.       else
  14.           next
  15. }
  16.